package com.lili.goods.service.impl;

import com.lili.goods.mapper.GoodsUnitMapper;
import com.lili.goods.service.GoodsUnitService;
import com.lili.model.goods.GoodsUnit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsUnitServiceImpl implements GoodsUnitService {

    @Autowired
    GoodsUnitMapper goodsUnitMapper;


    /*查询方法*/
    @Override
    public List<GoodsUnit> getUnit() {
        return goodsUnitMapper.selectList(null);
    }


    /*保存方法发*/
    @Override
    public int saveUnit(GoodsUnit goodsUnit) {
        return goodsUnitMapper.insert(goodsUnit);
    }


    /*更新方法*/
    @Override
    public int updateUnit(GoodsUnit goodsUnit) {
        return goodsUnitMapper.updateById(goodsUnit);
    }


    /*删除方法*/
    @Override
    public int deleteUnit(GoodsUnit goodsUnit) {
        return goodsUnitMapper.deleteById(goodsUnit);
    }
}
